<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>15.Symbol数据类型的介绍与创建</title>
</head>
<body>
    <script>
        // create Symbol
        let s = Symbol();
        console.log(s,typeof s);

        let s2 = Symbol('轩溪说');
        let s3 = Symbol('轩溪说');
        console.log(s2 === s3); // false

        // Symbol.for() Create
        let s4 = Symbol.for('轩溪说');
        let s5 = Symbol.for('轩溪说');
        console.log(s4 === s5); // true
        console.log(s4,typeof s4);

        // 不能与其他数据进行运算
        //let result = s + 100; //Cannot convert a Symbol value to a number

        // JS 数据类型总结 USONB you are so niubility
        // u underfined
        // s string symbol
        // o object 
        // n null number
        // b boolean

    </script>
</body>
</html>